class TaskCount {
    constructor(times, callback) {
        this.max = times;
        this.count = 0;
        this.callback = callback;
    }

    trigger() {
        this.count++;
        if (this.max === this.count) {
            this.callback();
        }
    }

    clear() {
        this.count = 0;
    }
}

export default TaskCount;
